//
//  UIView+CornerRadius.h
//  YSProject
//
//  Created by 昱胜 on 2021/12/22.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (CornerRadius)

- (void)clipAllCornerWithWidth:(CGFloat)width;

/// 切圆角
/// @param originView 视图
/// @param cornerWidth 圆角大小
/// @param cornerType 切圆角位置
- (UIView *)clipCornerWithView:(UIView *)originView
                   cornerWidth:(CGFloat)cornerWidth
                    cornerType:(UIRectCorner)cornerType;


/// 渐变色
/// @param view view description
/// @param startPoint 开始点
/// @param endPoint 结束点
/// @param startColor 开实颜色
/// @param endColor 结束颜色
- (void)configGradientWithView:(UIView *)view
                    startPoint:(CGPoint)startPoint
                      endPoint:(CGPoint)endPoint
                    startColor:(UIColor *)startColor
                      endColor:(UIColor *)endColor;


/// 虚线边框
/// @param view view description
/// @param lineColor 颜色
/// @param lineWidth 宽度
- (void)configDottedLineWithView:(UIView *)view
                       lineColor:(UIColor *)lineColor
                       lineWidth:(CGFloat)lineWidth;


// 创建一张渐变色图片
- (UIImage *)createImageSize:(CGSize)imageSize gradientColors:(NSArray *)colors percentage:(NSArray *)percents;


/**
 压缩图片
 */
- (NSData *)zipNSDataWithImage:(UIImage *)sourceImage;

@end

NS_ASSUME_NONNULL_END
